//============================================================================
// Name        : PatternHandler.h
// Author      : Anthea Neums, Jonas Halbach
//			   :
// Description : This Interface of the Class PatternHandler splits a Pattern-String
//					into a Parts of a specified length. This Parts are safed in a
//					Map, which stores the positions of this String part in a vector.
//============================================================================

#ifndef PATTERNHANDLER_H_
#define PATTERNHANDLER_H_

#include <stdlib.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <map>
#include "stdafx.h"
#include "CompareCString.h"

using namespace std;
namespace algorithm {

typedef map<char *, vector<int> *, CompareCString> HashMap;

class PatternHandler {
public:
	PatternHandler(char *value, int wordLength);
	virtual ~PatternHandler();

	/**
	 * Printing the content of the map. Helpfully for testing issues.
	 */
	void printPatternMap();

	/**
	 * Getting the positions in the pattern associated to the string.
	 * @param *string is the string, you want to get the associated positions of.
	 *
	 * @return a vector of positions associated to the specified string.
	 */
	vector<int> *getPositions(char *string);

private:
	/**
	 * Printing the content of a vector. Helpfully for testing issues.
	 */
	void printVector(vector<int> *vec);
	void deletePatternMap();
	HashMap *patternMap;

};

} /* namespace algorithm */
#endif /* PATTERNHANDLER_H_ */
